/**
 * 获取url 参数
 */

const getSearchParams = (params) => {
  if (!params) {
    return null;
  }
  const p = new URL(params).search.split("?")[1];
  const url = new URLSearchParams(p);
  const tmpObj = {};
  for (const [key, value] of url.entries()) {
    tmpObj[key] = value;
  }
  return tmpObj;
};

export default getSearchParams;
